<?php
require_once 'lib/ffwd/prototypes/view/clistexview.php';

class CListExSearchView extends CListExView{
	protected function renderHead(&$resultset,&$p=Array()){
		$action=preg_replace('/page=([0-9]*)/','',$_SERVER['REQUEST_URI']);
		$action=str_replace('&&','&',$_SERVER['REQUEST_URI']);
		if($this->e)$this->e->fromRow($p['condition']);
		echo '<tr>'."\n";
		foreach($p['order'] as $k=>$v){	
				if($this->e->$v->hidden)continue;			
			  echo 	'<td class="td" width="'.$p['colwidth']->$v.'%" '.$this->getTDStyle($p,$k).'>'."\n";
			  if($this->e)echo $this->e->fields[$v]->input(Array('class'=>'dbinput submitonenter'));
			  else{
			  	if(isset($p['condition'][$v]))$val=$p['condition'][$v];else $val='';
			  	echo '<input type="text" name="'.$v.'" class="dbinput submitonenter" searchfield="1"  value="'.$val.'" autocomplete="off" />';
			  };		  			
			  echo '</td>'."\n";
		};
		echo "</tr>\n";
		parent::renderHead($resultset,$p);
	}	
}
